package com.css.crm.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.css.crm.dao.QuestionnaireAnswerDao;
import com.css.crm.vo.QuestionnaireAnswerVo;

/**
 * Implementation for QuestionnaireAnswerDao
 * 
 * @author ais
 */
public class QuestionnaireAnswerDaoImpl extends BaseDaoImpl implements QuestionnaireAnswerDao {

	public QuestionnaireAnswerDaoImpl() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.QuestionnaireAnswerDao#getQuestionnaireAnswerById(com.css.crm.vo.
	 * QuestionnaireAnswerVo)
	 */
	@Override
	public QuestionnaireAnswerVo getQuestionnaireAnswerById(QuestionnaireAnswerVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectOne("questionnaireAnswer.getQuestionnaireAnswerById", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.css.crm.dao.QuestionnaireAnswerDao#deleteQuestionnaireAnswerById(com.css.crm.vo.
	 * QuestionnaireAnswerVo)
	 */
	@Override
	public int deleteQuestionnaireAnswerById(QuestionnaireAnswerVo vo) {

		SqlSession session = getMyBatisSession();
		return session.delete("questionnaireAnswer.deleteQuestionnaireAnswerById", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.QuestionnaireAnswerDao#insertQuestionnaireAnswer(com.css.crm.vo.QuestionnaireAnswerVo
	 * )
	 */
	@Override
	public int insertQuestionnaireAnswer(QuestionnaireAnswerVo vo) {

		SqlSession session = getMyBatisSession();
		return session.insert("questionnaireAnswer.insertQuestionnaireAnswer", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.QuestionnaireAnswerDao#updateQuestionnaireAnswer(com.css.crm.vo.QuestionnaireAnswerVo
	 * )
	 */
	@Override
	public int updateQuestionnaireAnswer(QuestionnaireAnswerVo vo) {

		SqlSession session = getMyBatisSession();
		return session.update("questionnaireAnswer.updateQuestionnaireAnswer", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.QuestionnaireAnswerDao#queryQuestionnaireAnswer(com.css.crm.vo.QuestionnaireAnswerVo
	 * )
	 */
	@Override
	public List<QuestionnaireAnswerVo> getQuestionnaireAnswer(QuestionnaireAnswerVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectList("questionnaireAnswer.getQuestionnaireAnswer", vo);
	}

}
